import cn.hutool.core.builder.Builder;

import java.util.ArrayList;
import java.util.List;

public class BuilderModren {
    public static void main(String[] args) {
        Productor build = Productor.builder()
                .part("part1")
                .part("part2")
                .part("part3")
                .build();
        build.showParts();
    }
}



class Productor implements Builder<Productor> {
    List<String> parts = new ArrayList<>();

    public static Productor builder() {
        return new Productor();
    }


    public Productor part(String part) {
        parts.add(part);
        return this;
    }
    @Override
    public Productor build() {
        return this;
    }

    public void showParts() {
        for (String part : parts) {
            System.out.print(part + " ");
        }
    }

}